home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / AppsToGo / AppsToGo.src / DTS.Draw / TRootObj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-18  |  2.0 KB  |  96 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        TRootObj.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1992 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11. /* You may incorporate this sample code into your applications without
  12. ** restriction, though the sample code has been provided "AS IS" and the
  13. ** responsibility for its operation is 100% yours.  However, what you are
  14. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  15. ** after having made changes. If you're going to re-distribute the source,
  16. ** we require that you make it clear in the source that the code was
  17. ** descended from Apple Sample Code, but that you've made changes. */
  18.  
  19. /* See the files "=How to write your app" and "=Using TreeObj.c" for information
  20. ** on this function. */
  21.  
  22.  
  23.  
  24. /*****************************************************************************/
  25.  
  26.  
  27.  
  28. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  29. #include "App.protos.h"        /* Get the prototypes for the application.        */
  30.  
  31. #ifndef __OSEVENTS__
  32. #include <OSEvents.h>
  33. #endif
  34.  
  35. #ifndef __OSUTILS__
  36. #include <OSUtils.h>
  37. #endif
  38.  
  39. #ifndef __QUICKDRAW__
  40. #include <Quickdraw.h>
  41. #endif
  42.  
  43. #ifndef __STRING__
  44. #include <String.h>
  45. #endif
  46.  
  47. #ifndef __TREEOBJ2__
  48. #include "TreeObj2.h"
  49. #endif
  50.  
  51. #ifndef __UTILITIES__
  52. #include "Utilities.h"
  53. #endif
  54.  
  55.  
  56.  
  57. #pragma segment DrawObjects
  58. long    TRootObj(TreeObjHndl hndl, short message, long data)
  59. {
  60.     short    fileRefNum;
  61.     char    *cptr;
  62.  
  63.     switch (message) {
  64.         case FREADMESSAGE:
  65.             fileRefNum = data;
  66.             return(ReadTreeObjData(hndl, fileRefNum));
  67.             break;
  68.  
  69.         case FWRITEMESSAGE:
  70.             fileRefNum = data;
  71.             return(WriteTreeObjData(hndl, fileRefNum));
  72.             break;
  73.  
  74.         case VHMESSAGE:
  75. #if VH_VERSION
  76.             cptr = ((VHFormatDataPtr)data)->data;
  77.             ccatchr(cptr, 13, 2);
  78.             VHRootInfo(hndl, cptr);
  79.             ccat   (cptr, "  $08: numSelected = ");
  80.             ccatdec(cptr, mDerefRoot(hndl)->numSelected);
  81.             ccatchr(cptr, 13, 2);
  82.             VHFileRecInfo(hndl, cptr);
  83.             return(true);
  84. #endif
  85.             break;
  86.  
  87.         default:
  88.             break;
  89.     }
  90.  
  91.     return(noErr);
  92. }
  93.  
  94.  
  95.  
  96.